package com.ass.llm.dto;

import com.ass.llm.constant.ModelEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

@Getter
@Setter
@Accessors(chain = true)
@AllArgsConstructor
public class ModelOut {

    //平台
    private String platform;

    //供应商
    private String modelSupplier;

    //模型类型
    private String modelType;

    //模型名称
    private String modelName;


    //获得模型属性集合
    public static List<ModelOut> getModelList() {
        return Arrays.stream(ModelEnum.values())
                .map(s -> new ModelOut(s.getPlatform(),s.getModelSupplier(), s.getModelType(), s.getModelName()))
                .collect(Collectors.toList());
    }

    public static ModelOut getModelByName(String modelName) {
        List<ModelOut> modelList = getModelList();
        return modelList.stream()
                .filter(s -> s.getModelName().equals(modelName)).findFirst().orElse(null);
    }

}
